


class SockerWrapper(object):
    #套接字包装类


    def __init__(self, socket):
        self.sock = socket

    def recv_data(self):

        try:
            return self.sock.recv(512).decode('utf-8')
        except:
            return ''

    def send_data(self, message):

        return self.sock.send(message.encode('utf-8'))

    def close(self):

        self.sock.close()